﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<#include "/pages/include/front_include.ftl" />
<@h.css href="/css/uc.css"/>
<@h.css href="/css/upload.css"/>
<@h.css href="/css/uploadify.css"/>
<@h.css href="/css/buttons.css"/>
<@h.js src="/javascripts/swfobject.js"/>
<@h.js src="/javascripts/jquery/jquery.uploadify.v2.1.4.min.js"/>
<@h.js src="/javascripts/public/myfile.js"/>
<script type="text/javascript">
	$(function(){
		$("#uploadify").uploadify({
                'uploader'       : '${contextPath}/javascripts/uploadify.swf',
                'script'         : '${contextPath}/component/upload-upload.action?tempFileId=${tempFileId}-photo',
                'cancelImg'      : '${contextPath}/images/cancel.png',
                'folder'         : '/uploads',
                'queueID'        : 'fileQueue',
                'auto'           : false,
                'multi'          : false,
                'simUploadLimit' : 1,
                'queueSizeLimit' : 1, 
                'sizeLimit'		 : 1024 * 1024 * 1,//1M
                'buttonText'     : 'Bowser',
                'fileDataName'   : 'uploadify',
                'removeCompleted': false,
                'displayData'    : 'speed',
                'fileExt'     	 : '*.jpg;*.gif;*.png',
  				'fileDesc'    	 : 'Image Files',
                'buttonImg'      : '${contextPath}/images/choose_file.png',
                 onComplete: function (event, queueID, fileObj, response, data) { 
								//alert("上传成功");  
								parent.loadImage('${tempFileId}');
							}, 
				onError: function(event, queueID, fileObj,errorObj) { 
				          if('File Size'==errorObj.type){
						  	alert('文件大小不能超过1M');
						  }else{
				          	alert("文件上传失败");
				          }  
				 		}
            });
	});
</script>
</head>

<body>
<@s.hidden id="tempFileId" name="tempFileId" value="${tempFileId}"/>
<div id="uploaderContainer" >
	<div id="fileQueue"></div>
    <div class="btn">
	    <input type="file" name="uploadify" id="uploadify"/>
	    <div class="btnUC">
		    <a href="javascript:jQuery('#uploadify').uploadifyUpload()" class="minibutton"><span>上传</span></a>
		    <a href="javascript:jQuery('#uploadify').uploadifyClearQueue()" class="minibutton"><span>取消</span></a>
	    </div>
    </div>
</div>
<div class="clear">
</div>
<div id="step1" >
	<h3 class="header">上传须知</h3>
	<p>大小不能超过1M</p>
</div>
</body>

</html>
